package com.itcam.controller;

import com.itcam.pojo.User;
import org.springframework.web.bind.annotation.*;

/**
 * projectName: com.itcam.controller
 * <p>
 * description: 用户模块的控制器
 */
@RequestMapping("user")
@RestController
public class UserController {

    @GetMapping("data1")
    public String data1() {
        //空指针异常
        String name = null;
        System.out.println("UserController.data");
        name.toString(); //空指针异常 NullPointerException
        return "ok";
    }

    @GetMapping("data2")
    public String data2() {
        //算数异常
        System.out.println("UserController.data1");
        int i = 1/0; //除零异常 ArithmeticException
        return "ok";
    }
}